import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JTextPane;


public class VOpciones extends JFrame implements ActionListener{

	private JPanel contentPane;
	private JButton btnExaminarC;
	private JButton btnExaminarS;
	private JButton btnSalir;
	private JFrame ventanaAnterior;

	
	public VOpciones(JFrame ventanaAnterior) {
		this.ventanaAnterior = ventanaAnterior;
		setVisible(true);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		btnExaminarC = new JButton("Examinar");
		btnExaminarC.setBounds(282, 60, 89, 23);
		contentPane.add(btnExaminarC);
		
		btnExaminarS = new JButton("Examinar");
		btnExaminarS.setBounds(282, 127, 89, 23);
		contentPane.add(btnExaminarS);
		
		btnSalir = new JButton("Salir");
		btnSalir.setBounds(172, 212, 89, 23);
		contentPane.add(btnSalir);
		
		JTextPane txtpnCambiarColor = new JTextPane();
		txtpnCambiarColor.setEditable(false);
		txtpnCambiarColor.setText("Cambiar color del fondo");
		txtpnCambiarColor.setBounds(91, 60, 148, 20);
		contentPane.add(txtpnCambiarColor);
		txtpnCambiarColor.setOpaque(false);
		
		JTextPane txtpnCambiarSonido = new JTextPane();
		txtpnCambiarSonido.setEditable(false);
		txtpnCambiarSonido.setText("Cambiar sonido");
		txtpnCambiarSonido.setBounds(91, 130, 148, 20);
		contentPane.add(txtpnCambiarSonido);
		txtpnCambiarSonido.setOpaque(false);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		
		
		JButton botonpulsado = (JButton) e.getSource();
		
		if(botonpulsado == btnExaminarC){
			new VExaminar("C");
			
		}else if(botonpulsado == btnExaminarS){
			new VExaminar("S");
			
		}else if(botonpulsado == btnSalir){
			ventanaAnterior.setVisible(true);
			setVisible(false);
		}
		
	}
}
